#include <stdio.h>

int strdiff(char *a, char *b)
{
    while (*a && *b && *a == *b)
        a++, b++;
    return *a - *b;
}

int main()
{
    char a[1010], b[1010];
    while (scanf("%s%s", a, b) == 2)
    {
        printf("%d\n", strdiff(a, b));
    }
    return 0;
}
